#include <gtest\gtest.h>
#include <Zaf\String\Lettercase.h>



#define DO_TEST(method, pre, result)     \
{                                        \
std::string str(pre);                    \
std::wstring wstr(L##pre);               \
const std::string cstr(pre);             \
const std::wstring wcstr(L##pre);        \
std::string rstr;                        \
std::wstring rwstr;                      \
Zaf::String::method(str);                \
ASSERT_EQ(result, str);                  \
Zaf::String::method(wstr);               \
ASSERT_EQ(L##result, wstr);              \
rstr = Zaf::String::method(cstr);        \
ASSERT_EQ(result, rstr);                 \
rwstr = Zaf::String::method(wcstr);      \
ASSERT_EQ(L##result, rwstr);             \
rstr = Zaf::String::method(pre);         \
ASSERT_EQ(result, rstr);                 \
rwstr = Zaf::String::method(L##pre);     \
ASSERT_EQ(L##result, rwstr);             \
}

#define TEST_TOUPPERCASE(pre, result) DO_TEST(ToUppercase, pre, result)
#define TEST_TOLOWERCASE(pre, result) DO_TEST(ToLowercase, pre, result)



TEST(Lettercase, ToUppercase) {

	TEST_TOUPPERCASE("123abcXYZ", "123ABCXYZ");
}



TEST(Lettercase, ToLowercase) {

	TEST_TOLOWERCASE("123abcXYZ", "123abcxyz");
}